﻿{% extends "base.html" %}

{% block scripts %}
{% endblock %}

{% block content %}
    <h1>Предложения</h1>
    {% if offers.object_list %}
        <ul class="paging">
            {% if offers.has_previous %}
                <li class="item"><a href="/company_offers/{{ company.id }}/{{ offers.previous_page_number }}/"><img class="icon" src="/media/images/icon_arrow_2.gif" width="11" height="5"></a></li>
            {% endif %}

            {% for page in offers.paginator.page_range %}
                {% if page == offers.number %}
                    <li class="item item_current">{{ page }}</li>
                {% else %}
                    <li class="item"> <a href="/company_offers/{{ company.id }}/{{ page }}/">{{ page }}</a></li>
                {% endif %}
            {% endfor %}

            {% if offers.has_next %}
                <li class="item"><a href="/company_offers/{{ company.id }}/{{ offers.next_page_number }}/"><img class="icon" src="/media/images/icon_arrow_1.gif" width="11" height="5"></a></li>
            {% endif %}
        </ul>
    {% endif %}


    <ul class="info_list_1 offer_list">
        {% for offer in offers.object_list %}
            <li class="list_item list_item_first">

                <img class="pic"
                        {% if offer.company.logo %}
                     src="{{ offer.company.logo.url }}"
                        {% if offer.company.logo.width > offer.company.logo.height %} width="79" {% else %} height="79" {% endif %}
                        {% else %}
                     src="/media/images/img_no.gif" width="79" height="79"
                        {% endif %}
                        />

                <div class="item_base">
                    <dl class="info">
                        <dt>Компания:</dt>
                        <dd><a href="/company/{{ offer.company.id }}">{{ offer.company.name }}</a></dd>
                    </dl>
                    <div class="text">{{ offer.text|linebreaksbr }}</div>
                </div>
            </li>
        {% endfor %}
    </ul>

    {% if offers.object_list %}
        <ul class="paging">
            {% if offers.has_previous %}
                <li class="item"><a href="/company_offers/{{ company.id }}/{{ offers.previous_page_number }}/"><img class="icon" src="/media/images/icon_arrow_2.gif" width="11" height="5"></a></li>
            {% endif %}

            {% for page in offers.paginator.page_range %}
                {% if page == offers.number %}
                    <li class="item item_current">{{ page }}</li>
                {% else %}
                    <li class="item"> <a href="/company_offers/{{ company.id }}/{{ page }}/">{{ page }}</a></li>
                {% endif %}
            {% endfor %}

            {% if offers.has_next %}
                <li class="item"><a href="/company_offers/{{ company.id }}/{{ offers.next_page_number }}/"><img class="icon" src="/media/images/icon_arrow_1.gif" width="11" height="5"></a></li>
            {% endif %}
        </ul>
    {% endif %}

{% endblock %}